package com.sort;

import java.util.Arrays;

public class test3 {
  public static void main(String[] args) {
    // 向数组头插入元素；
    int[] arr = {1, 2, 3, 4, 5};
    int n = 9;
    int[] new_arr = new int[arr.length + 1];
    System.arraycopy(arr, 0, new_arr, 1, arr.length - 1);
    new_arr[0] = n;
    System.out.println(Arrays.toString(new_arr));
  }
}
